﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// ProductUniqueID数据模型对象
    /// </summary>
    [Serializable]
    public partial class ProductUniqueIDMod
    {
        /// <summary>
        /// 初始化ProductUniqueID数据模型对象
        /// </summary>
        public ProductUniqueIDMod()
        {
            
        }
        /// <summary>
        /// 初始化ProductUniqueID数据模型对象并给在SQL中不能为空的字段赋值
        /// </summary>
        /// <param name="iD">ID</param>
        /// <param name="model">Model</param>
        /// <param name="productDate">ProductDate</param>
        /// <param name="uniqueID">UniqueID</param>
        public ProductUniqueIDMod(int iD,string model,string productDate,string uniqueID)
        {
            //给ID字段赋值
            this.ID = iD;
            //给Model字段赋值
            this.Model = model;
            //给ProductDate字段赋值
            this.ProductDate = productDate;
            //给UniqueID字段赋值
            this.UniqueID = uniqueID;
        }
        /// <summary>
        /// 初始化ProductUniqueID数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="iD">ID</param>
        /// <param name="model">Model</param>
        /// <param name="productDate">ProductDate</param>
        /// <param name="uniqueID">UniqueID</param>
        /// <param name="setupDate">SetupDate</param>
        public ProductUniqueIDMod(int iD,string model,string productDate,string uniqueID,DateTime? setupDate)
        {
            //给ID字段赋值
            this.ID = iD;
            //给Model字段赋值
            this.Model = model;
            //给ProductDate字段赋值
            this.ProductDate = productDate;
            //给UniqueID字段赋值
            this.UniqueID = uniqueID;
            //给SetupDate字段赋值
            this.SetupDate = setupDate;
        }
        
		//属性存储数据的变量
        private int _iD;
        private string _model;
        private string _productDate;
        private string _uniqueID;
        private DateTime? _setupDate;
        
        /// <summary>
        /// ID
        /// </summary>
        public int ID
        {
            get { return this._iD; }
            set { this._iD = value; }
        }
        /// <summary>
        /// Model
        /// </summary>
        public string Model
        {
            get { return this._model; }
            set { this._model = value; }
        }
        /// <summary>
        /// ProductDate
        /// </summary>
        public string ProductDate
        {
            get { return this._productDate; }
            set { this._productDate = value; }
        }
        /// <summary>
        /// UniqueID
        /// </summary>
        public string UniqueID
        {
            get { return this._uniqueID; }
            set { this._uniqueID = value; }
        }
        /// <summary>
        /// SetupDate
        /// </summary>
        public DateTime? SetupDate
        {
            get { return this._setupDate; }
            set { this._setupDate = value; }
        }
        
        /// <summary>
        /// 对比两个ProductUniqueID数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的ProductUniqueID数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成ProductUniqueID数据模型对象
            ProductUniqueIDMod productUniqueIDMod = obj as ProductUniqueIDMod;
            //判断是否转换成功
            if (productUniqueIDMod == null) return false;
            //进行匹配属性的值
            return
                //判断ID是否一致
                this.ID == productUniqueIDMod.ID &&
                //判断Model是否一致
                this.Model == productUniqueIDMod.Model &&
                //判断ProductDate是否一致
                this.ProductDate == productUniqueIDMod.ProductDate &&
                //判断UniqueID是否一致
                this.UniqueID == productUniqueIDMod.UniqueID &&
                //判断SetupDate是否一致
                this.SetupDate == productUniqueIDMod.SetupDate;
        }
        /// <summary>
        /// 将当前ProductUniqueID数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将ProductUniqueID数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将ID进行按位异或运算处理
                this.ID.GetHashCode() ^
                //将Model进行按位异或运算处理
                (this.Model == null ? 2147483647 : this.Model.GetHashCode()) ^
                //将ProductDate进行按位异或运算处理
                (this.ProductDate == null ? 2147483647 : this.ProductDate.GetHashCode()) ^
                //将UniqueID进行按位异或运算处理
                (this.UniqueID == null ? 2147483647 : this.UniqueID.GetHashCode()) ^
                //将SetupDate进行按位异或运算处理
                (this.SetupDate == null ? 2147483647 : this.SetupDate.GetHashCode());
        }
        /// <summary>
        /// 将当前ProductUniqueID数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前ProductUniqueID数据模型对象转换成字符串副本
            return
                "[" +
                //将ID转换成字符串
                this.ID + "," +
                //将Model转换成字符串
                this.Model + "," +
                //将ProductDate转换成字符串
                this.ProductDate + "," +
                //将UniqueID转换成字符串
                this.UniqueID +
                "]";
        }
    }
}
